package com.itheima.集合Collecton.MyCoullection;


import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class MyCollectionDemo2 {
    public static void main(String[] args) {
        Collection<String> col=new ArrayList<>();

        col.add("a");
        col.add("b");
        col.add("c");
        col.add("d");

        Iterator<String> ite = col.iterator();


        while (ite.hasNext()){
            System.out.println(ite.next());
        }
        ite = col.iterator();//需要再次循环需要重新接收
        while (ite.hasNext()){
            System.out.print(ite.next()+"   ");
        }//无效果


    }

}
